From 3fc5b3282fab6a78e8e5cc0290e78a5a988f1fc1 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 15 Sep 2009 09:09:18 +0100 Subject: [PATCH] PoD: Don't reclaim xenheap pages in zero-sweep Don't reclaim xenheap-allocated pages in the zero-sweep. This avoids grabbing things like grant tables mapped in the p2m. Signed-off-by: George Dunlap --- xen/arch/x86/mm/p2m.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 15c6b921be..7317cbe8cf 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -759,7 +759,7 @@ p2m_pod_zero_check_superpage(struct domain *d, unsigned long gfn) * + All gfns are ram types * + All gfns have the same type * + All of the mfns are allocated to a domain - * + None of the mfns are used as pagetables + * + None of the mfns are used as pagetables, or allocated via xenheap * + The first mfn is 2-meg aligned * + All the other mfns are in sequence * Adding for good measure: @@ -769,7 +769,8 @@ p2m_pod_zero_check_superpage(struct domain *d, unsigned long gfn) if ( !p2m_is_ram(type) || type != type0 || ( (mfn_to_page(mfn)->count_info & PGC_allocated) == 0 ) - || ( (mfn_to_page(mfn)->count_info & PGC_page_table) != 0 ) + || ( (mfn_to_page(mfn)->count_info & (PGC_page_table|PGC_xen_heap)) != 0 ) + || ( (mfn_to_page(mfn)->count_info & PGC_xen_heap ) != 0 ) || ( (mfn_to_page(mfn)->count_info & PGC_count_mask) > max_ref ) || !( ( i == 0 && superpage_aligned(mfn_x(mfn0)) ) || ( i != 0 && mfn_x(mfn) == (mfn_x(mfn0) + i) ) ) ) @@ -860,11 +861,11 @@ p2m_pod_zero_check(struct domain *d, unsigned long *gfns, int count) for ( i=0; icount_info & PGC_allocated) != 0 ) - && ( (mfn_to_page(mfns[i])->count_info & PGC_page_table) == 0 ) + && ( (mfn_to_page(mfns[i])->count_info & (PGC_page_table|PGC_xen_heap)) == 0 ) && ( (mfn_to_page(mfns[i])->count_info & PGC_count_mask) <= max_ref ) ) map[i] = map_domain_page(mfn_x(mfns[i])); else -- 2.30.2